<!--<?php
print <<<EOT
-->

<!--Content Start-->
<table width="95%" border="0" align="center">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
    
      <form action="p_product.php" method="post" name="form1" enctype="multipart/form-data">
      <table width="60%" align="left">
      <tr><td>
      <table width="60%" border="0" align="center">
        <tr> 
          <td align="right">
            <input type="image" src="../images/admin/bt_cancel.gif" width="78" height="23" onclick="return false;"> 
            <input type="image" src="../images/admin/bt_save.gif" width="76" height="22"  > 
          </td>
        </tr>
      </table>
      </td></tr>
    
      <tr><td>
      <table width="95%" border="0" align="center">
        <tr> 
          <td align="right">&nbsp; </td>
        </tr>
        <tr> 
          <td>
            <table border="0" cellspacing="0" cellpadding="2">
              <tr valign="vtop"> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr valign="vtop"> 
                <td>Code :</td>
                <td>
                  <input type="text" class="text" name="code" value="$code">	  
                  <input name="action" type="hidden" value="add">
                </td>
              </tr>
              <tr valign="vtop"> 
                <td>Name :</td>
                <td><textarea class="text" name="name" cols="40" rows="2"  ></textarea></td>
              </tr>
              <tr valign="vtop"> 
                <td>Small Picture :</td>
                <td><input type="file" class="text" name="up_small_pic" size=50></td>
              </tr>
              <tr valign="vtop"> 
                <td>Picture :</td>
                <td><input type="file" class="text" name="up_pic" size=50></td>
              </tr>
              <tr valign="vtop"> 
                <td>Finish Shown :</td>
                <td><input type="text" class="text" name="finishshown" value=""></td>
              </tr>
              <tr valign="vtop"> 
                <td>Fabric Shown :</td>
                <td><input type="text" class="text" name="fabricshown" value=""></td>
              </tr>
              <tr valign="vtop"> 
                <td>Leather Shown :</td>
                <td><input type="text" class="text" name="leathershown" value=""></td>
              </tr>
              <tr valign="vtop"> 
                <td>Marble Shown :</td>
                <td><input type="text" class="text" name="marbleshown" value=""></td>
              </tr>							
              <tr valign="vtop"> 
                <td>Depth :</td>
                <td><input type="text" class="text" name="length" value=""> CM</td>
              </tr>
              <tr valign="vtop"> 
                <td>Width :</td>
                <td><input type="text" class="text" name="width" value=""> CM</td>
              </tr>
              <tr valign="vtop"> 
                <td>Height :</td>
                <td><input type="text" class="text" name="height" value=""> CM</td>
              </tr>
              
              <tr valign="vtop"> 
                <td>Depth :</td>
                <td><input type="text" class="text" name="length2" value=""> INCH</td>
              </tr>
              <tr valign="vtop"> 
                <td>Width :</td>
                <td><input type="text" class="text" name="width2" value=""> INCH</td>
              </tr>
              <tr valign="vtop"> 
                <td>Height :</td>
                <td><input type="text" class="text" name="height2" value=""> INCH</td>
              </tr>
              
              <tr valign="vtop"> 
                <td>Cbm :</td>
                <td><input type="text" class="text" name="cbm" value=""></td>
              </tr>
              <tr valign="vtop"> 
                <td>Cuft :</td>
                <td><input type="text" class="text" name="cuft" value=""></td>
              </tr>
              
              
              <tr valign="vtop"> 
                <td>Price : </td>
                <td>
                  <input type="text" class="text" name="price_1" size="10"  value=  > (USD) Mixed Container Price <br> 
                  <input type="text" class="text" name="price_2" size="10" value=  > (USD) Direct Container Price <br>
                  <input type="text" class="text" name="price_3" size="10" value=  > (HKD) Hong Kong Wholesaler Price <br> 
                </td>
              </tr>
              <tr valign="vtop"> 
                <td>New Item :</td>
                <td>							  
                  <select class="select" name="new_flag"  >
                  <option value=1>Yes</option><option value=0 selected>No</option></select> 
                </td>
              </tr>              
              <tr valign="vtop"> 
                <td>Hidden in product :</td>
                <td>							  
                  <select class="select" name="hidden_flag"  >
                  <option value=1>Yes</option><option value=0 selected>No</option></select> 
                </td>
              </tr>
              <tr valign="vtop"> 
                <td>Description :</td>
                <td><textarea class="text" name="comment" cols="40" rows="4"  ></textarea></td>
              </tr>
              
              <tr valign="vtop"> 
                <td>Inventory :</td>
                <td>
                
                  <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
                    <tr class="tbheader">
                      <td align="left">Inventory</td>
                      <td align="center">Available Qty</td>
                      <td align="center">Special Price</td>
                    </tr>

<!--
EOT;
for($i=0; $i<$inventory_ary_num; $i++){
    // ΪHK warehouse Ҫ2sp
    if ($inventory_ary[$i]['type'] == 1) {
        $ovr_desc = 'Ovr ';
        $hk_sp = ' HK <input id="sp2_' . $inventory_ary[$i]['id'] . '" value="' . $inventory_sp2_ary[$inventory_ary[$i]['id']] . '" type="text" name="sp2_ary[' . $inventory_ary[$i]['id'] . ']" size="5"  disabled="disabled" />';
    } else {
        $ovr_desc = '';
        $hk_sp = '<input id="sp2_' . $inventory_ary[$i]['id'] . '" value="0" type="hidden" name="sp2_ary[' . $inventory_ary[$i]['id'] . ']"  disabled="disabled" />';
    }
    print <<<EOT
-->
                    
                    <tr class="tbcontent1">
                      <td align="left"><input type="checkbox" name="inventory_id[]" value="{$inventory_ary[$i]['id']}" onchange="if ( this.checked==true){qty_{$inventory_ary[$i]['id']}.disabled=false;sp_{$inventory_ary[$i]['id']}.disabled=false;sp2_{$inventory_ary[$i]['id']}.disabled=false;} else {qty_{$inventory_ary[$i]['id']}.disabled=true;sp_{$inventory_ary[$i]['id']}.disabled=true;sp2_{$inventory_ary[$i]['id']}.disabled=true;}" />{$inventory_ary[$i]['name']}</td>
                      <td align="center"><input id="qty_{$inventory_ary[$i]['id']}" type="text" name="qty_ary[{$inventory_ary[$i]['id']}]" size="3" disabled="disabled" /></td>
                      <td align="center">{$ovr_desc}<input id="sp_{$inventory_ary[$i]['id']}" type="text" name="sp_ary[{$inventory_ary[$i]['id']}]" size="8" disabled="disabled" />{$hk_sp}</td>
                    </tr>
                    
<!--
EOT;
} print <<<EOT
--> 

                  </table>
                    
                </td>
              </tr>
              <tr valign="vtop"> 
                <td>category :</td>
                <td>
                    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="tb">
                    <tr class="tbheader">
                      <td align="left">Category/Sub Category</td>
                      <td align="center">Product Sequence</td>
                    </tr>

<!--
EOT;
for($i=0; $i<$category_ary_num; $i++){
    $s = $ss = '';
    $s =           '<tr class="tbcontent1">
                      <td align="left"><input type="checkbox" name="category_id[]" value="' . $category_ary[$i]['id'] . '" onchange="if ( this.checked==true){seq_' . $category_ary[$i]['id'] . '.disabled=false;} else {seq_' . $category_ary[$i]['id'] . '.disabled=true;}" />' . $category_ary[$i]['name'] . '</td>
                      <td align="center"><input id="seq_' . $category_ary[$i]['id'] . '" type="text" name="category_seq[' . $category_ary[$i]['id'] . ']" size="3" disabled="disabled" /></td>
                    </tr>';
    if (!empty($sub_category_select_ary[$category_ary[$i]['id']])) {
        foreach ($sub_category_select_ary[$category_ary[$i]['id']] as $k1=>$v1) {
            $ss .= '<tr class="tbcontent1">
                      <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="category_id[]" value="' . $k1 . '" onchange="if ( this.checked==true){seq_' . $k1 . '.disabled=false;} else {seq_' . $k1 . '.disabled=true;}" />' . $v1 . '</td>
                      <td align="center"><input id="seq_' . $k1 . '" type="text" name="category_seq[' . $k1 . ']" size="3" disabled="disabled" /></td> 
                    </tr>';
        }
    }
    !empty($ss) && $s = '<tr class="tbcontent1" height="20">
                      <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $category_ary[$i]['name'] . '</td>
                      <td align="center"></td>
                    </tr>';
    print <<<EOT
-->

                    $s
                    $ss

<!--
EOT;
} print <<<EOT
--> 
                    </table>
                </td>
              </tr>
              
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
     </td></tr>
    
      <tr><td>
      <table width="60%" border="0" align="center">
        <tr> 
          <td align="right">
            <input type="image" src="../images/admin/bt_cancel.gif" width="78" height="23" onclick="Redirect('product_menu.php',1);return false;"> 
            <input type="image" src="../images/admin/bt_save.gif" width="76" height="22" > 
          </td>
        </tr>
      </table>
      </td></tr>
      </table>
      </form>

      <p>&nbsp;</p></td>
  </tr>
</table>
<!--Content End-->

<!--
EOT;
?>-->